home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Testing & Debugging / Virtual User tools / SPEC S&L v.1.0.1 / Scripts / Excel4.vu < prev    next >
Encoding:
Text File  |  1993-12-17  |  6.8 KB  |  188 lines  |  [TEXT/MPS ]

  1. #
  2. # ****************************************************************************
  3. #
  4. #    File Name:        Excel4.vu
  5. #
  6. #    Contains:    Quick look test script for Excel version 4.0
  7. #
  8. #    Written by:    Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
  9. #
  10. #    Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  11. #
  12. # ****************************************************************************
  13. #            C h a n g e        H i s t o r y (most recent first):
  14. # ****************************************************************************
  15. #
  16. #        Vers      Date        Author        Description
  17. #        ----    --------    ------    ---------------------------------------------
  18. #     <1.0.4>     7/19/93    KTA        Updates for FindWindow() to handle descriptors.
  19. #     <1.0.3>     7/14/93    KTA        Fixed Bug - gCustomNewDocDialog was defined, but it was not
  20. #                                    defined as a list.
  21. #     <1.0.2>     6/16/93    NAGA        Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
  22. #        <1+>     5/25/93    NAGA        Adding header and porting old files to follow new standards
  23. #
  24. # ****************************************************************************
  25. #
  26.  
  27.  
  28.  
  29. ########################################################################
  30. #                            External libraries 
  31. #=======================================================================
  32. Libraries "Output.Lib", "DoTasks.Lib","UserInterface.Lib","Draw.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
  33.  
  34.  
  35. #########################################################################
  36. ########               Application Specific Tasks
  37. #########################################################################
  38.  
  39. #########################################################################
  40. #                        InitAppGlobals()
  41. #========================================================================
  42. # Author:        ML
  43. # Description:    Sets up tools and fonts for Excel.  This task
  44. #                must be called first.
  45. # Parameters:    None
  46. # Returns:        Nothing
  47. # Examples:        InitAppGlobals()
  48. #========================================================================
  49. # History:
  50. #
  51. ########################################################################
  52. task InitAppGlobals()
  53. begin
  54.     
  55.     logstr("setting up {global gApptitle}'s globals");            
  56.     global kClick, kDrag, kMultiDrag, kMultiClickDrag, kMultiClick;
  57.     global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
  58.     global gDocumentWindow := [window c:True g:True z:True]!;
  59.     global gCustomNewDocDialog := [window t:'New']!;
  60.     global gDoWindowList := {1,0,1,1}; # VU doesn't recognize scrollbars
  61.     global gScreenInset := {0,40,0,50}; # Allow for toolbars at top and bottom
  62.     
  63.  
  64.     # Not tools or fonts set up because of Excel limitations - see note below
  65.     
  66. end;    #InitAppGlobals
  67.  
  68. #########################################################################
  69. #                            NumberCalc()
  70. #========================================================================
  71. # Author:        KTA
  72. # Description:    Enters in a numbers to be used in a simple speadsheet 
  73. #                calculation.
  74. # Parameters:    None
  75. # Returns:        Nothing
  76. # Examples:        NumberCalc();
  77. # Assumptions:    None 
  78. #========================================================================
  79. # History:
  80. #
  81. #########################################################################
  82. task NumberCalc() begin
  83.     numbersList :={"=sum(b18:b22)",40,30,20,10,1000};
  84.     SpecialKey( rightarrowkey, "RightArrow Key");
  85.     TypeList(NumbersList,4,1);
  86. end;
  87.  
  88. #########################################################################
  89. #                            TextLabels()
  90. #========================================================================
  91. # Author:        KTA
  92. # Description:    Enters in a Labels to be used in a simple speadsheet 
  93. #                calculation.
  94. # Parameters:    None
  95. # Returns:        Nothing
  96. # Examples:        TextLabels();
  97. # Assumptions:    None 
  98. #========================================================================
  99. # History:
  100. #
  101. #########################################################################
  102. task TextLabels() begin
  103.     textList :={"Quarterly Earnings","Mortgage", "Paper", "Utilities", "Garbage", 'Phone', 'Total'};
  104.     LogStr("Beginning Excel Example",3);
  105.     TypeList(textList,1);
  106. end;
  107.  
  108. #########################################################################
  109. #                            ExcelEx()
  110. #========================================================================
  111. # Author:        KTA
  112. # Description:    Sets up a  simple speadsheet calculation test.
  113. # Parameters:    None
  114. # Returns:        Nothing
  115. # Examples:        ExcelEx();
  116. # Assumptions:    None 
  117. #========================================================================
  118. # History:
  119. #
  120. #########################################################################
  121. task ExcelEx() begin
  122.     SelectMenuItem('Goto...', 'Formula');
  123.     TypeStr("A17");
  124.     SpecialKey( returnkey, "return Key");
  125.     TextLabels();
  126.     NumberCalc();
  127.     LogStr("Entered some data and performed a calculation",3);
  128. end;
  129.  
  130. #########################################################################
  131. #                            Views()
  132. #========================================================================
  133. # Author:        ML
  134. # Description:    Test Views
  135. # Parameters:    Kind
  136. # Returns:        Nothing
  137. # Examples:        Views();
  138. # Assumptions:    None 
  139. #========================================================================
  140. # History:
  141. #
  142. ########################################################################
  143. task Views()
  144. begin
  145.     logstr("Changing Views...");
  146.     SizeButtonLoc := {{26,50},{26,86},{26,104},{26,121},{26,68}};
  147.     SizeButtonList:= {'200%','75%','50%','25%','100%'};
  148.     CardButtonLoc := card(SizeButtonLoc);
  149.     for i := 1 to CardButtonLoc
  150.     begin
  151.         ButtonLoc := SizeButtonLoc[i];
  152.         SelectMenuItem("Zoom...", "Window");
  153.         sizebutton :=SizeButtonList[i]; 
  154.         logstr("Selecting the {sizebutton} radio button",1);
  155.         MoveRelativeToWindow(ButtonLoc[1],ButtonLoc[2],'Zoom',2);
  156.         SpecialKey( returnkey, "return Key");
  157.     end;
  158. end;
  159.  
  160. ################################################################################
  161. ####################             Main script                    ####################
  162. ################################################################################
  163. script Excel (ScriptLevel:= -1)
  164. begin
  165.     InitGlobals(ScriptLevel);            # initialize your general globals
  166.     InitDraw();
  167.     InitFonts();
  168.     global gAppTitle := 'Microsoft Excel';     # Title of app you will be running
  169.     global gAppVersion := '4';        # version of app you will be running
  170.     SuiteStart('Excel4.vu');                    # begin a new test suite
  171.     if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
  172.     begin
  173.         global gFileName := "@!@-{gBuildVers}-Excel";    # This is used in NameOK when saving files
  174.         InitAppGlobals();                                # init app specific globals
  175.         (*
  176.         *)
  177.         DoSetUpApp(,,,1,1,1);
  178.         ExcelEx();
  179.         DoWindow();
  180.         Views();
  181.         DoCloseApp();
  182.         LogStr("############################# LIMITATIONS: ############################");
  183.         LogStr("NOTE: No DoText because Excel has uses a font dialog box.  No DoDraw
  184.         because there is no way for VU to: 1) uniquely identify the draw palette and 
  185.         2) know whether the palette is set up as a floating window or a toolbar.");
  186.     end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
  187.     SuiteEnd();
  188. end;    #    script Excel